<?php
defined('BASEPATH') OR exit('No direct script access allowed');

?>

 
                    <div class="row">
                        <div class="col-md-12">
                             <div class="box">
                                <div class="box-header with-border">
                                    <h3 class="box-title">导出“<?php echo $shop["name"];?>”商品到CSV文件</h3>
                                </div>
                                <div class="box-body">
                                    <?php echo $message;?>
                                   
                                    <?php echo form_open(current_url(), array('class' => 'form-horizontal', 'id' => 'form-create_notice')); ?>
                                          <div class="form-group">
                                          <?php  echo '<label for="prefix"'._stringify_attributes(array('class' => 'col-sm-2 control-label')).'>SKU前缀</label>';?>
                                            <div class="col-sm-10">
                                                <span style="line-height:20px;"><?php echo form_input($prefix);?></span>
                                            </div>
                                        </div>

                                       <div class="form-group">
                                          <?php  echo '<label for="vendor"'._stringify_attributes(array('class' => 'col-sm-2 control-label')).'>供应商</label>';?>
                                            <div class="col-sm-10">
                                                <span style="line-height:20px;"><?php echo form_input($vendor);?></span>
                                            </div>
                                       </div>
                                      
                                       <div class="form-group">
                                          <?php  echo '<label for="type"'._stringify_attributes(array('class' => 'col-sm-2 control-label')).'>商品分类</label>';?>
                                            <div class="col-sm-10">
                                                <span style="line-height:20px;"><?php echo form_input($type);?></span>
                                            </div>
                                       </div>
                                       <div class="form-group">
                                        <label class="col-sm-2 control-label">导出平台</label>
                                        <div class="col-sm-10">
                                        <select class="form-control" name="platform" id="platform">
                                            <option value="shopify">shopify</option>
                                            <option value="xlsx">xlsx</option>
                                        </select>
                                        </div>
                                        </div>
               
                                        <?php if(empty($checkstring)){?>

                                        <div class="form-group">
                                        <label class="col-sm-2 control-label">生成条件条件</label>
                                        <div class="col-sm-10">
                                         <select name="filtertype"  id="filtertype" class="form-control">
                                            <option value="1">按时间范围</option>
                                            <option value="2">起始数字</option>
                                            <option value="3">按关键字</option>
                                         </select>
                                        </div>
                                        </div>


                                        <div class="form-group filtercol" id="filtertype1">
                                        <label class="col-sm-2 control-label">时间范围限制</label>
                                        <div class="col-sm-10">
                                        <?php echo tpl_form_field_daterange("timelimit",[],true);?>
                                        </div>
                                        </div>


                                        <div class="form-group filtercol" id="filtertype2" style="display:none">
                                        <label class="col-sm-2 control-label">按时间升序</label>
                                        <div class="col-sm-10"><div class="col-xs-4">
                                        <div class="input-group">
                <span class="input-group-addon">开始数</span>
                <input type="number" name="start" class="form-control">
                </div> </div>
                <div class="col-xs-4"> <div class="input-group">
                <span class="input-group-addon">结束数</span>
                <input type="number" name="end" class="form-control">
                </div>
              </div>
                                        </div>
                                        </div>


                                        <div class="form-group filtercol" id="filtertype3" style="display:none">
                                        <label class="col-sm-2 control-label">标题关键字</label>
                                        <div class="col-sm-10">
                                        <span style="line-height:20px;"><input type="text" name="skey" value="" id="skey" class="form-control"></span>
                                        <span class="helper">多个关键字用 , (英文的逗号) 隔开</span>
                                        </div>
                                        </div>
                                                    <?php }
                                                    else
                                                    {
                                                        echo '<input type="hidden" name="filtertype" value="0">';
                                                    }
                                                    
                                                    ?>

                                        <div class="form-group">
                                          <?php  echo '<label for="price_muti"'._stringify_attributes(array('class' => 'col-sm-2 control-label')).'>价格倍数</label>';?>
                                            <div class="col-sm-10">
                                                <span style="line-height:20px;"><?php echo form_input($price_muti);?></span>
                                            </div>
                                       </div>

                                      <div id="opensky" style="display:none;">
                                       <div class="form-group" >
                                          <?php  echo '<label for="other[market_ratio]"'._stringify_attributes(array('class' => 'col-sm-2 control-label')).'>市场价比例</label>';?>
                                            <div class="col-sm-10">
                                            <select class="form-control" name="other[market_ratio]">
                                                <option value="0.6">60%</option>
                                                <option value="0.65">65%</option>
                                            </select>
                                            </div>
                                       </div>

                                       <div class="form-group" >
                                          <?php  echo '<label for="other[shippingfee]"'._stringify_attributes(array('class' => 'col-sm-2 control-label')).'>邮费设置</label>';?>
                                            <div class="col-sm-10">
                                            <select class="form-control" name="other[shippingfee]">
                                                <option value="1">3.99 & 1.99</option>
                                                <option value="2">包邮</option>
                                            </select>
                                            </div>
                                       </div>

                                       <div class="form-group" >
                                          <?php  echo '<label for="other[descset]"'._stringify_attributes(array('class' => 'col-sm-2 control-label')).'>保留描述</label>';?>
                                            <div class="col-sm-10">
                                            <select class="form-control" name="other[descset]">
                                                <option value="1">否</option>
                                                <option value="2">是</option>
                                            </select>
                                            </div>
                                       </div>

                                     </div>


                                       <div class="form-group">
                                            <div class="col-sm-offset-2 col-sm-10">
                                                <div class="btn-group">
                                                    <?php echo form_hidden('id', $shop["id"]);?>

                                                    <?php echo form_button(array('type' => 'submit', 'class' => 'btn btn-primary btn-flat', 'content' => lang('actions_submit'))); ?>
                                                    <?php echo form_button(array('type' => 'reset', 'class' => 'btn btn-warning btn-flat', 'content' => lang('actions_reset'))); ?>
                                                </div>
                                            </div>
                                        </div>

                                        <input type="hidden" name="ids" value=" <?php echo $checkstring;?>">
                                    <?php echo form_close();?>
                                </div>
                            </div>
                         </div>
                    </div>
           
<script>
$("#filtertype").change(function(){
    var selected=$(this).children('option:selected').val();
    $(".filtercol").hide();
    $("#filtertype"+selected).show();
});

$("button[type='submit']").on("click",function(){layer.load(1, {
  shade: [0.1,'#000'] //0.1透明度的白色背景
});})
</script>